package rolesystem.roles.game;

import rolesystem.core.RoleAction;
import rolesystem.roles.KnownEvent;

/**
 * This role is the player of a generic game.
 * Keywords: game, player.
 */
public abstract class Player
{
	/**
	 * Role identifier.
	 */
	public static final String ROLE_ID="game.Player";


	/**
	 * A manager notifies the kind of the game.
	 * Sender role: Manager
	 * Content: Kind of the game.
	 */
	public static final KnownEvent KE_notifyKind=new KnownEvent("notifyKind", Manager.ROLE_ID, String.class);

	/**
	 * A manager notifies that I can play.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_accept=new KnownEvent("accept", Manager.ROLE_ID);

	/**
	 * A manager notifies that I cannot play.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_refuse=new KnownEvent("refuse", Manager.ROLE_ID);

	/**
	 * A manager notifies the current situation of the game.
	 * Sender role: Manager
	 * Content: Situation of the game.
	 */
	public static final KnownEvent KE_notifySituation=new KnownEvent("notifySituation", Manager.ROLE_ID, java.io.Serializable.class);

	/**
	 * A manager requests to make my move.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_requestMove=new KnownEvent("requestMove", Manager.ROLE_ID);

	/**
	 * A manager refuse my move.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_refuseMove=new KnownEvent("refuseMove", Manager.ROLE_ID);

	/**
	 * A manager notifies that I have won the game.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_gameWon=new KnownEvent("gameWon", Manager.ROLE_ID);

	/**
	 * A manager notifies that I have lost the game.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_gameLost=new KnownEvent("gameLost", Manager.ROLE_ID);

	/**
	 * A manager notifies that the game is over.
	 * Sender role: Manager
	 */
	public static final KnownEvent KE_gameOver=new KnownEvent("gameOver", Manager.ROLE_ID);

	/**
	 * Another player talks.
	 * Sender role: Player
	 * Content: Message.
	 */
	public static final KnownEvent KE_talk=new KnownEvent("talk", Player.ROLE_ID, String.class);


	/**
	 * Asks the kind of the game.
	 * @param addressee Manager
	 */
	public static RoleAction askKind(int addressee)
	{
		return new RoleAction("askKind", addressee);
	}

	/**
	 * Requests to play.
	 * @param addressee Manager
	 */
	public static RoleAction reqPlay(int addressee)
	{
		return new RoleAction("reqPlay", addressee);
	}

	/**
	 * Makes a move.
	 * @param addressee Manager
	 * @param content Move.
	 */
	public static RoleAction Move(int addressee, java.io.Serializable content)
	{
		return new RoleAction("Move", addressee, content);
	}

	/**
	 * Gives up the current game.
	 * @param addressee Manager
	 */
	public static RoleAction giveUp(int addressee)
	{
		return new RoleAction("giveUp", addressee);
	}

	/**
	 * Talks.
	 * @param addressee Player
	 * @param content Message.
	 */
	public static RoleAction talk(int addressee, String content)
	{
		return new RoleAction("talk", addressee, content);
	}
}
